<?php
include_once "xAP-functions/webincludes.php";
$id=intval($_GET["id"]);
// setup?
if (isset($_GET["set"])){
	dbexec("update xAP_EventElement set EventLibraryID=".intval($_GET["set"])." where EventElementID=".$id); 
}

	//library is already set so display form
	$results=dbquery("select * from xAP_Event where EventID=".$id);
	$l=$results[0];
	
	$body.="<span class='boldtext'>".$l["Alias"]."</span><BR>";
	
	$body.="<span class='normaltext'>
	<form id='settingsform'>
	<input type='hidden' name='id' value=$id>
	<table>
	<TR><TD>Name</TD><TD><input name='name' value=\"".$l["Alias"]."\" size=20></TD></TR>
	<TR><TD>Active</TD>
	<TD>";
	if($l["Active"]==1){
	$body.="<input type='checkbox'  name='active' value='1' CHECKED>";
	}else{
	$body.="<input type='checkbox'  name='active' value='1'>";
	}
	$body.="</TD></TR>
	<TR><TD>BSC</TD>
	<TD>";
	if($l["BSC"]==1){
	$body.="<input type='checkbox'  name='bscactive' value='1' CHECKED>";
	}else{
	$body.="<input type='checkbox'  name='bscactive' value='1'>";
	}
	$body.="</TD></TR>";
	
	
	$body.="<TR><TD colspan=2><input type='button' value='Update' OnClick='UpdateSettings($id)'></TD></TR></table></form>";



?>
<span  class='boldtext'>Settings</span><BR><BR>
<span class='normaltext'><?=$body?></span>